#A line plot showing the counts of items in each aisle
instacart |>
count(aisle) |>
filter(n > 10000) |>
mutate(aisle = fct_reorder(aisle, n)) |>
mutate(rank = min_rank(desc(n))) |>
arrange(desc(n)) |>
plot_ly(
x = ~aisle, y = ~n, type = "scatter", mode = "markers",
alpha = 0.5)
#A bar plot show what aisle had the most sale during a week.
try_df =
instacart |>
count(aisle) |>
filter(n > 10000)
bar_plot =
inner_join(try_df, instacart, by = "aisle") |>
mutate(order_dow = fct_reorder(order_dow, n)) |>
plot_ly(x = ~order_dow, y = ~n, color = ~order_dow, type = "bar", colors = "viridis")
bar_plot